#pragma once
//@author A0088044A
#include <iostream>  
#include <fstream> 
#include <vector>
#include <sstream>
#include "tinyxml.h" 
#include "Task.h"
#include "Logger.h"
#include "Utilities.h"

using namespace std;  

/*
typedef struct storage_INFO  {       
string id; //id   
int time; //time   
int date; //date   
string description; //description   
}Task;  
*/

class Storage{
private:
	vector<Task> list;
	int totalNumberOfTasks;
	Task result;
	Logger& logger;

	TaskStatus stringToTaskStat(string);
	string taskStatusToString(TaskStatus);

public:
	Storage(void);
	~Storage(void);

	string addTask(Task);      // add
	Task retrieve(string); //  retrieve
	
	vector<Task> search(string); //   search by key word
	vector<Task> displayToday();    //   display task on current day
 
	void modify(Task);
	void setStatus(string, TaskStatus);
	void undone(string);
	void remove(string); //      remove task
	void removeLast();
	int WriteXmlToFile( ) ;  //  write to xml
	int ReadXmlFromFile(  )  ;//   read from xml
	void unremove(string);
};



